package com.winona.domain;

public class MenuDomain {
	public enum MenuItems {
		HOME(0), SENSITIVE(1), ACNE(2), STAIN(3), DRY(4), COMPLEX(5), COSMETOLOGY(
				6), CONVERSATION(7), TEST(8), CENTER(9), USERLOGIN(10);
		private int itemNo;

		MenuItems(int itemNo) {
			this.itemNo = itemNo;
		}

		public int getItemNo() {
			return itemNo;
		}
	}

	private static boolean[] menus = new boolean[] { false, false, false,
			false, false, false, false, false, false, false, false };

	private static boolean[] menuClickable = new boolean[] { true, true, true,
			true, true, true, true, true, true, true, true };

	public static void resetMenu() {
		menus[0] = false;
		menus[1] = false;
		menus[2] = false;
		menus[3] = false;
		menus[4] = false;
		menus[5] = false;
		menus[6] = false;
		menus[7] = false;
		menus[8] = false;
		menus[9] = false;
		menus[10] = false;

	}

	public static void resetMenuClickable() {
		menuClickable[0] = true;
		menuClickable[1] = true;
		menuClickable[2] = true;
		menuClickable[3] = true;
		menuClickable[4] = true;
		menuClickable[5] = true;
		menuClickable[6] = true;
		menuClickable[7] = true;
		menuClickable[8] = true;
		menuClickable[9] = true;
		menuClickable[10] = true;

	}

	public static void open(MenuItems muItem) {
		resetMenu();
		if (muItem.getItemNo() < menus.length) {
			menus[muItem.getItemNo()] = true;
		}
	}

	public static boolean isOpen(MenuItems muItem) {
		if (muItem.getItemNo() < menus.length) {
			return menus[muItem.getItemNo()];
		} else {
			return false;
		}
	}

	public static boolean isClickable(MenuItems muItem) {
		if (muItem.getItemNo() < menuClickable.length) {
			return menuClickable[muItem.getItemNo()];
		} else {
			return false;
		}
	}

	public static void setUnclickable(MenuItems muItem) {
		if (muItem.getItemNo() < menuClickable.length) {
			menuClickable[muItem.getItemNo()] = false;
		}
	}

}
